import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

import { resolve, sep } from "path";
import { fileURLToPath } from "url";

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [react()],
	resolve: {
		alias: {
			"@": resolve(__dirname, "./src"),
			components: resolve(__dirname, "./src/components"),
			assets: resolve(__dirname, "./src/assets")
		}
	},
	server: {
		host: true, // 显示多个开发地址
		port: 8081, // 服务端口号
		open: true, // 服务启动时是否自动打开浏览器
		cors: true // 允许跨域
	}
});
